From ac61c93e1563712865b6837a56045ab7e4d95399 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 15 Sep 2009 10:08:12 +0100 Subject: [PATCH] xenoprof: force use of architectural perfmon instead of the CPU specific event set, which may be not supported by oprofile user space tool yet. Signed-off-by: Yang Zhang Signed-off-by: Yang Xiaowei --- xen/arch/x86/oprofile/nmi_int.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c index d05d7a360c..07050457f3 100644 --- a/xen/arch/x86/oprofile/nmi_int.c +++ b/xen/arch/x86/oprofile/nmi_int.c @@ -344,11 +344,26 @@ static int __init p4_init(char ** cpu_type) } +static int force_arch_perfmon; +static int force_cpu_type(const char *str) +{ + if (!strcmp(str, "arch_perfmon")) { + force_arch_perfmon = 1; + printk(KERN_INFO "oprofile: forcing architectural perfmon\n"); + } + + return 0; +} +custom_param("cpu_type", force_cpu_type); + extern int ppro_has_global_ctrl; static int __init ppro_init(char ** cpu_type) { __u8 cpu_model = current_cpu_data.x86_model; + if (force_arch_perfmon && cpu_has_arch_perfmon) + return 0; + switch (cpu_model) { case 0 ... 2: *cpu_type = "i386/ppro"; -- 2.30.2